package com.ctgu.fcftsystem.service;

import com.ctgu.fcftsystem.dao.UserDao;
import com.ctgu.fcftsystem.pojo.User;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class UserServiceImpl implements UserService{

    @Autowired(required=false)
    private UserDao userDao;


    @Override
    public List<User> findByPaging(int pageCount, int pageSize) {
        return userDao.findByPaging(pageCount, pageSize);
    }

    @Override
    public User login(String uid, String upwd) {

        return userDao.login(uid,upwd);
    }

    @Override
    public User getUserId(String uid) {
        return userDao.getUserId(uid);
    }

    @Override
    public List<User> getUserList() {
        return userDao.getUserList();
    }

    @Override
    public int addUser(User user) {
        return userDao.addUser(user);
    }

    @Override
    public int delUserById(String uid) {
        return userDao.delUserById(uid);
    }

    @Override
    public int updateUser(User user) {
        return userDao.updateUser(user);
    }

    @Override
    public int updateUserPwd(String uid, String upwd) {
        return userDao.updateUserPwd(uid,upwd);
    }

    @Override
    public List<User> searchUser(User user) {
        return userDao.searchUser(user);
    }

    @Override
    public User getUserMoneyById(String uid) {
        return userDao.getUserMoneyById(uid);
    }

    @Override
    public int setUserMoneyById(String uid, int umoney) {
        return userDao.setUserMoneyById(uid, umoney);
    }


}
